package com.yiyuan.app.entity.enums;

/**
 * @Author: sunxuzong
 * @Date: 2024/07/19
 */
public enum DeviceErrorEnum {
    normal(0,"正常"),
    pushCoinsError(1,"异常出币"),
    coinPushError(2,"入币器故障"),
    coinBackError(3,"回币器故障"),
    coinHopperError(4,"退币器故障"),
    pushDiscMotorError(5,"推盘马达故障"),
    wiperMotorError(6,"雨刷马达故障"),
    swingChannelError(7,"摇摆通道异常"),
    coinPushNone(8,"入币器空"),
    coinHopperNone(9,"退币器空"),
    coinHopperFull(10,"退币槽满"),
    pushRateError(11,"推币率错误"),
    machineSway(12,"机台摇晃"),
    jamCoinChannel1(13,"通道1卡币"),
    jamCoinChannel2(14,"通道2卡币"),
    jamCoinChannel3(15,"通道3卡币"),
    jamCoinChannel4(16,"通道4卡币"),
    jamCoinChannel5(17,"通道5卡币"),
    jamCoinChannel6(18,"通道6卡币"),
    jamCoinChannel7(19,"通道7卡币"),
    jamCoinChannel8(20,"通道8卡币"),
    jamCoinChannel9(21,"通道9卡币"),
    upCoinMotorError(22,"上币马达故障"),
    coinBackMotorError(23,"回币/数币马达故障"),
    coinHopperMotorError(24,"退币/彩票器马达故障"),
    pushCoinMachineError(25,"投币器故障"),
    communicationError(26,"通讯帧字节数不符"),
    checkError(27,"帧校验字节不对"),
    noExistCommand(28,"不存在的命令"),
    ferroelectricOperateError(30,"铁电硬件操作故障"),
    dataCheckError(31,"数据校验错误"),
    copyrightError(32,"版权错误"),
    chipError(33,"芯片错误"),
    serialPortError(34,"串口通信错误"),
    awardError(35,"出奖异常"),
    algorithmError(64,"算法错误"),
    ferroelectricError(128,"铁电错误"),
    unknownError(129,"未知错误"),
    connectErrorCOM1(130,"连接错误COM1"),
    connectErrorCOM3(131,"连接错误COM3"),
    noResponseCOM1(132,"无响应COM1"),
    noResponseCOM3(133,"无响应COM3"),
    unInitA1(227,"没有发初始化A1命令")
    ;

    private Integer code;

    private String desc;

    DeviceErrorEnum(Integer code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public static DeviceErrorEnum getByCode(Integer code){
        for (DeviceErrorEnum enums : DeviceErrorEnum.values()){
            if (enums.getCode().equals(code)){
                return enums;
            }
        }
        return  null;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }
}
